feat(BOP-495): ERC-8056 interface-review follow-ups (renames + Conversion extension) - #192
Conversation
Rename the ERC-8056 interface file to IERC8056.sol per the Aug 4 2026 B20 interface review. File rename only: the three interface identifiers (IScaledUIAmount, IScaledUIAmountNewUIMultiplier, IScaledUIAmountBalances) and every wire symbol are unchanged. Updates all import paths and one doc comment reference. Co-authored-by: Cursor <cursoragent@cursor.com>
…ors/events Per the Aug 4 2026 B20 interface review, rename the Cobalt-only ERC-8056 scheduled-multiplier symbols to the "UI Multiplier" vocabulary: error ScheduleOverlap -> PendingUpdateExists error NoScheduledMultiplier -> NoScheduledUIMultiplier event MultiplierUpdateCancelled -> UIMultiplierUpdateCancelled Updates the IB20Asset interface, the MockB20Asset reference implementation, the affected unit tests, the scheduled-multiplier smoke journey, and the docs. These symbols are Cobalt-only (AssetV2) and not yet live, so the rename is safe. Co-authored-by: Cursor <cursoragent@cursor.com>
Advertise the canonical instant-failsafe under the ERC-8056 "UI Multiplier" vocabulary as `updateUIMultiplier` and de-advertise the legacy `updateMultiplier` from IB20Asset. The MockB20Asset reference keeps `updateMultiplier` dialable (delegating to the shared body) so the precompile's retained legacy selector stays cross-validated by the fork tests; a regression test pins that the legacy selector remains callable and still emits UIMultiplierUpdated. B20FactoryLib gains encodeUpdateUIMultiplier (canonical) and keeps encodeUpdateMultiplier (legacy, encoded by signature). Docs and smoke journeys are swept separately in the reconciliation commit. Co-authored-by: Cursor <cursoragent@cursor.com>
Add the ERC-8056 Conversion extension interface (id 0x57854fc3) to IERC8056.sol, inherit it on IB20Asset, and advertise it via supportsInterface. The MockB20Asset reference implements toUIAmount/fromUIAmount and keeps the legacy toScaledBalance/toRawBalance dialable (shared bodies) so the precompile's retained legacy selectors stay cross-validated; a regression test pins that they remain callable and agree with the canonical converters. toScaledBalance/toRawBalance are de-advertised from IB20Asset; the dedicated tests move to toUIAmount/fromUIAmount, and B20FactoryLib/docs are updated. The "Conversion extension not claimed" doc statement is flipped. Remaining doc/smoke naming is swept in the reconciliation commit. Co-authored-by: Cursor <cursoragent@cursor.com>
Advertise MAX_UI_MULTIPLIER() (== type(uint128).max) on IB20Asset. The MockB20Asset reference declares it as a public constant (single source of truth, auto-generated getter) and the setter guards reference it, so callers can read the accepted-multiplier bound without hitting the InvalidMultiplier revert path. Pinned to the uint128 overflow guard by a constants test. Co-authored-by: Cursor <cursoragent@cursor.com>
Sweep the docs and smoke journeys for the renamed/added surface and document the
event reconciliation:
- docs/B20/Asset.md: use updateUIMultiplier / toUIAmount / fromUIAmount as the
canonical names (noting the retained-but-de-advertised legacy selectors),
expose MAX_UI_MULTIPLIER(), and spell out the intended double event — an
instant updateUIMultiplier that supersedes a *live* schedule emits
UIMultiplierUpdateCancelled then UIMultiplierUpdated{block.timestamp}, and
AssetV2 never emits the legacy V1 MultiplierUpdated (not part of IB20Asset).
- scheduled_multiplier.py (Cobalt-only): switch to the canonical
updateUIMultiplier / toUIAmount.
- asset_lifecycle.py (cross-fork): keep the legacy updateMultiplier /
toScaledBalance / toRawBalance selectors — the only multiplier/conversion
selectors dialable on both Beryl and Cobalt — with a comment explaining why.
abis.py appends their fragments since IB20Asset no longer advertises them.
Co-authored-by: Cursor <cursoragent@cursor.com>
Interface Coverage✅ All interface functions have test coverage. |
📊 Forge Coverage (
|
| File | Lines | Stmts | Branches | Funcs |
|---|---|---|---|---|
| 🟡 B20FactoryLib.sol | 97.70% | 98.00% | 100.00% | 95.00% |
| 🔴 test/lib/ForceFeeder.sol | 0.00% | 0.00% | 100.00% | 0.00% |
| 🔴 test/lib/PrecompileProbe.sol | 0.00% | 0.00% | 0.00% | 0.00% |
| 🟢 MockActivationRegistry.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟢 MockActivationRegistryStorage.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟢 MockB20.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟢 MockB20Asset.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟡 MockB20Factory.sol | 98.96% | 99.10% | 100.00% | 100.00% |
| 🟢 MockB20Stablecoin.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟢 MockB20Storage.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| 🟡 MockPolicyRegistry.sol | 100.00% | 99.54% | 97.67% | 100.00% |
| 🟢 MockPolicyRegistryStorage.sol | 100.00% | 100.00% | 100.00% | 100.00% |
| Total | 97.06% | 97.51% | 98.14% | 97.00% |
Full report: download artifact. To browse locally: make coverage (runs forge coverage + genhtml + opens the HTML report).
|
The Cobalt conformance leg patched current base/base (this PR's renamed/added ERC-8056 surface) into base-anvil but ran the previously-pinned base-std reference, which still expects the pre-rename symbols — a guaranteed mismatch. Point the Cobalt base_std_ref at the paired base-std commit (base/base-std#192) so the two repos are cross-validated in lockstep. Beryl (v1.0.0) is unchanged; V1 is frozen and untouched by this PR. Co-authored-by: Cursor <cursoragent@cursor.com>
Remove verbose comments in IB20Asset.sol, script/smoke/abis.py, and script/smoke/journeys/asset_lifecycle.py per review feedback; the code is self-explanatory. Co-authored-by: Cursor <cursoragent@cursor.com>
Follow the base-std PR head after dropping review comments (base/base-std#192); keeps the conformance pair in lockstep. Co-authored-by: Cursor <cursoragent@cursor.com>
…MultiplierUpdated Per reviewer intent, the instant multiplier setter (updateUIMultiplier and the retained updateMultiplier) now emits the deprecated MultiplierUpdated(newMultiplier) alongside the ERC-8056 UIMultiplierUpdated, so indexers on the legacy topic keep working. The scheduled setUIMultiplier still emits only UIMultiplierUpdated. Re-declares MultiplierUpdated on IB20Asset, emits it from MockB20Asset's shared instant-setter body (cancel -> MultiplierUpdated -> UIMultiplierUpdated), and updates the affected unit/regression tests, smoke journeys, and docs. Co-authored-by: Cursor <cursoragent@cursor.com>
|
(fork tests need the names in base/base #4285 to land before passing) |
… not removed Per review: match the agreed deprecation pattern (mirroring #193's burnBlocked) — retain the legacy functions in the interface, marked DEPRECATED, rather than removing them. Removing them broke the block-explorer customer class. Re-declares updateMultiplier / toScaledBalance / toRawBalance on IB20Asset with `@notice DEPRECATED.` docs pointing at updateUIMultiplier / toUIAmount / fromUIAmount. Reverts the workarounds the removal forced: drops the manual _DEPRECATED_ASSET_SELECTORS ABI fragments in smoke (the selectors are back in the compiled ABI), restores abi.encodeCall in B20FactoryLib.encodeUpdateMultiplier, and switches the deprecation regression tests to typed calls. Docs/mocks updated. Co-authored-by: Cursor <cursoragent@cursor.com>
|
PR Body still describes the previous approach of dropping deprecated methods. Also your local env is leaking into the PR body via |
Address review feedback (#192): the smoke journeys now assert the instant setter emits the deprecated MultiplierUpdated alongside UIMultiplierUpdated (dual event), so correct the README rows — the `multiplier` journey exercises updateUIMultiplier and expects UIMultiplierUpdated + UIMultiplierUpdateCancelled + MultiplierUpdated; the `asset` rebase emits both events on Cobalt. Also drops a stale example from the assert_no_log docstring. Co-authored-by: Cursor <cursoragent@cursor.com>
ilikesymmetry
left a comment
There was a problem hiding this comment.
I'm having second thoughts now on if our setter and cancellation system should be proactively designed for queueing multiple updates. I recall this is a somewhat known use case. If we know we're eventually going to have to build such a thing, I'd prefer to spend an extra cycle to get it right now so we don't have as much to change. Probably worth a longer conversation though.
| error InvalidMetadataKey(); | ||
|
|
||
| /// @notice A multiplier setter (`setUIMultiplier` or `updateMultiplier`) was called with a | ||
| /// @notice A multiplier setter (`setUIMultiplier` or `updateUIMultiplier`) was called with a |
There was a problem hiding this comment.
we only have one setter right?
| /// @notice A multiplier setter (`setUIMultiplier` or `updateUIMultiplier`) was called with a | |
| /// @notice `updateUIMultiplier` was called with a |
There was a problem hiding this comment.
there are two, the instantaneous failsafe (legacy) updateMultiplier and the newer updateUIMultiplier
| /// @dev Reverts with `InvalidMultiplier` when `newMultiplier` is zero or above `type(uint128).max`. | ||
| /// | ||
| /// @param newMultiplier New multiplier scaled to `WAD_PRECISION`; must be in `(0, type(uint128).max]`. | ||
| function updateUIMultiplier(uint256 newMultiplier) external; |
There was a problem hiding this comment.
confused, don't we have a setUIMultiplierUpdate that we just need to rename? Whatever function we are adding in Cobalt needs to have the effectiveAt parameter
There was a problem hiding this comment.
we (b20 + tequities) had decided to keep the instantaneous updateMultiplier function as an admin failsafe, partly because its "tech debt" can't be aliased under the new function
There was a problem hiding this comment.
(as opposed to the new updateUIMultiplier that accepts the effectiveAt parameter)
…ultiplier vocabulary for cancel + errors Addresses ilikesymmetry's review on #192. The canonical Cobalt setter is now the scheduled `updateUIMultiplier(newMultiplier, effectiveAt)` (rename of `setUIMultiplier`), rather than an added instant alias. The instant path stays as the deprecated `updateMultiplier` (retained, dialable). Also, for "UI multiplier update" vocabulary parity: - cancelScheduledMultiplier -> cancelUIMultiplierUpdate - PendingUpdateExists(effectiveAt) -> UIMultiplierUpdateExists(effectiveAt) - NoScheduledUIMultiplier -> UIMultiplierUpdateDoesNotExist The redundant instant `updateUIMultiplier(uint256)` alias is dropped. Interface, mock, factory encoders, unit/regression/storage tests, smoke journeys and docs updated in lockstep. Co-authored-by: Cursor <cursoragent@cursor.com>
this was litigated in a conversation with the tequities team around 3 weeks ago, and the current design leaves room for future extension. ofc we can reverse that decision but I toward that being overengineering for a problem that we have not faced yet. it would also bring into question the value of the ongoing audit since a refactor of that size touches more than just the cosmetic naming we're currently refactoring |
…95-schedule-multiplier-updates-interface-review-follow-ups
…sion extension) (base#4285) * refactor(BOP-495): adopt UI-multiplier vocabulary for Cobalt-only errors/events Per the Aug 4 2026 B20 interface review, rename the Cobalt-only ERC-8056 scheduled-multiplier symbols to the "UI Multiplier" vocabulary: error ScheduleOverlap -> PendingUpdateExists error NoScheduledMultiplier -> NoScheduledUIMultiplier event MultiplierUpdateCancelled -> UIMultiplierUpdateCancelled These symbols were introduced at Cobalt (AssetV2) and are not yet activated on any network (Cobalt is unscheduled on mainnet/sepolia), so a pure rename of the wire surface is consensus-safe. The frozen Beryl (V1) surface is untouched. Regenerates V2_ABI_FINGERPRINT (V1 fingerprint and the shared-signature pins are unchanged). Co-authored-by: Cursor <cursoragent@cursor.com> * feat(BOP-495): add updateUIMultiplier alias; deprecate updateMultiplier Add the canonical ERC-8056-vocabulary instant-failsafe selector `updateUIMultiplier(uint256)` at Cobalt (AssetV2), routing to the same `Asset::update_multiplier` logic (identical behavior and events). The Beryl-live `updateMultiplier` selector is FROZEN, so this is add-alias + deprecate (not rename): the legacy selector stays dialable in the precompile (the V2 selector set is intentionally, permanently larger) and only base-std's advertised interface drops it. Regenerates V2_ABI_FINGERPRINT and the frozen selector set (20 -> 21); the v1-subset delta grows 8 -> 9. V1 fingerprint and the frozen Beryl surface are untouched. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(BOP-495): adopt IScaledUIAmountConversion (toUIAmount/fromUIAmount) Reverse the prior opt-out and claim the ERC-8056 Conversion extension (0x57854fc3) at Cobalt. Add `toUIAmount(uint256)` (raw->UI) and `fromUIAmount(uint256)` (UI->raw) selectors routing to the existing `to_scaled_balance` / `to_raw_balance` logic (identical behavior, effective multiplier). Advertise 0x57854fc3 in ERC8056_INTERFACE_IDS (supports_interface already returns any advertised id), add the XOR pin, and invert the "conversion extension not claimed" test. Names/id cross-checked against the live ERC-8056 spec; the XOR pin confirms 0x57854fc3 == toUIAmount ^ fromUIAmount. The Beryl-live toScaledBalance / toRawBalance selectors are frozen, so this is add-alias + deprecate: they stay dialable in the precompile and only base-std de-advertises them. Regenerates V2_ABI_FINGERPRINT and the frozen selector set (21 -> 23); v1-subset delta 9 -> 11. Rationale for the reversal: maximize ERC-8056 conformance and explorer/builder DevX; legacy names remain dialable so nothing on-chain breaks. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(BOP-495): expose MAX_UI_MULTIPLIER() view Add a Cobalt-only MAX_UI_MULTIPLIER() getter returning type(uint128).max, the overflow guard the multiplier setters enforce. Previously callers had to trigger the InvalidMultiplier revert path to learn the bound. Introduce the constant on AssetV2 as the single source of truth and have set_ui_multiplier / update_multiplier reference it; expose it via a version-gated Asset trait read (reject_frozen_selector! default, V2 override), matching the other V2-only reads. Regenerates V2_ABI_FINGERPRINT and the frozen selector set (23 -> 24); v1-subset delta 11 -> 12. WAD_PRECISION() already satisfied the "multiplier precision getter" review ask and is unchanged. Co-authored-by: Cursor <cursoragent@cursor.com> * test(BOP-495): update Asset V2 golden suite for the interface-review surface Merged origin/main brought in the Asset V2 golden suite (base#4270), which predated this branch. Reconcile it with the BOP-495 renames/additions: - Rename the Cobalt-only symbol references (PendingUpdateExists, NoScheduledUIMultiplier, UIMultiplierUpdateCancelled). - Add golden tests for the new selectors: updateUIMultiplier (aliases updateMultiplier), toUIAmount/fromUIAmount (Conversion aliases), and MAX_UI_MULTIPLIER; wire them into the exhaustive op-coverage match. - Flip supportsInterface(0x57854fc3) to advertised (Conversion extension now claimed). - Re-bless ROOT_CANCEL_SCHEDULED_MULTIPLIER and ROOT_UPDATE_MULTIPLIER_CLEARS_PENDING: hash_token_state hashes emitted log topics, so renaming the cancel event's topic0 shifts those two roots. Storage behavior is unchanged; all other roots are identical. Co-authored-by: Cursor <cursoragent@cursor.com> * ci(BOP-495): pin Cobalt fork-test base-std to the paired BOP-495 commit The Cobalt conformance leg patched current base/base (this PR's renamed/added ERC-8056 surface) into base-anvil but ran the previously-pinned base-std reference, which still expects the pre-rename symbols — a guaranteed mismatch. Point the Cobalt base_std_ref at the paired base-std commit (base/base-std#192) so the two repos are cross-validated in lockstep. Beryl (v1.0.0) is unchanged; V1 is frozen and untouched by this PR. Co-authored-by: Cursor <cursoragent@cursor.com> * ci(BOP-495): re-pin Cobalt fork-test base-std to latest paired commit Follow the base-std PR head after dropping review comments (base/base-std#192); keeps the conformance pair in lockstep. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(BOP-495): instant setter emits deprecated MultiplierUpdated + UIMultiplierUpdated Per reviewer intent, AssetV2's instant setter (update_multiplier, dialed via updateMultiplier / updateUIMultiplier) now emits the deprecated V1 MultiplierUpdated(newMultiplier) alongside the ERC-8056 UIMultiplierUpdated, for backward compatibility with indexers on the legacy topic. The scheduled set_ui_multiplier is unchanged (only UIMultiplierUpdated). Event order on an instant override of a live schedule: UIMultiplierUpdateCancelled -> MultiplierUpdated -> UIMultiplierUpdated. Updates the abi doc + unit tests, and re-blesses the V2 golden roots for update_multiplier, update_multiplier_clears_pending, and announce_v2 (the extra log topic shifts those hashes; no storage-behavior change). Re-pins the Cobalt fork-test base_std_ref to the paired base-std commit. Co-authored-by: Cursor <cursoragent@cursor.com> * ci(BOP-495): re-pin Cobalt base-std; sync abi docs to deprecation-in-interface Point the Cobalt fork-test base_std_ref at the paired base-std commit (which now retains the deprecated methods in IB20Asset rather than removing them). Update the abi/v2.rs doc comments to say the legacy updateMultiplier / toScaledBalance / toRawBalance are kept in base-std's interface as deprecated aliases (not removed), and that updateMultiplier now emits both MultiplierUpdated and UIMultiplierUpdated. Comment-only; V2_ABI_FINGERPRINT unchanged. Co-authored-by: Cursor <cursoragent@cursor.com> * ci(BOP-495): re-pin Cobalt base-std to 399ee93 (doc-only fix on the pair) Co-authored-by: Cursor <cursoragent@cursor.com> * refactor(BOP-495): make updateUIMultiplier the scheduled setter; UI-multiplier vocabulary for cancel + errors Addresses ilikesymmetry's review on base-std base#192, applied to the Cobalt (AssetV2) wire surface (Cobalt is not live, so these Cobalt-only selectors are free to rename): - setUIMultiplier(newMultiplier, effectiveAt) -> updateUIMultiplier(newMultiplier, effectiveAt) (the canonical scheduled setter); the redundant instant updateUIMultiplier(uint256) alias is dropped. The instant path remains as the deprecated updateMultiplier(uint256). - cancelScheduledMultiplier -> cancelUIMultiplierUpdate - PendingUpdateExists(effectiveAt) -> UIMultiplierUpdateExists(effectiveAt) - NoScheduledUIMultiplier -> UIMultiplierUpdateDoesNotExist Selector set 24 -> 23; V2 ABI fingerprint and V1-subset delta (12 -> 11) regenerated. Golden coverage, dispatch, labels and unit tests updated; storage/event roots are unchanged (renames don't alter storage or emitted topics). Re-pins the Cobalt conformance gate to the paired base-std commit 22d67a4. Co-authored-by: Cursor <cursoragent@cursor.com> * ci(BOP-495): re-pin Cobalt base-std to d0a3c16 (base-std in lockstep with main); tidy v1 golden doc Bumps the Cobalt conformance pin to the base-std commit that merged base-std main, so the paired SEIZE_RECEIVER_POLICY / seizeWithMemo changes (base-std base#188/base#193, base/base base#4252) line up with the seize behavior this branch inherited from base/base main. Fixes the 4 seizeWithMemo Cobalt fork-test failures, which were a cross-repo skew, not a rename regression. Also reflows one doc comment in the V1 golden negative test (no behavior change). Co-authored-by: Cursor <cursoragent@cursor.com> * test(BOP-495): assert all 11 V2-only selectors are excluded from the frozen V1 surface The v1<>v2 freeze-guard only iterated the 8 scheduled-multiplier selectors; extend it to the full 11-selector Cobalt delta by adding toUIAmount / fromUIAmount / MAX_UI_MULTIPLIER, matching the delta pinned by v1_selectors_are_a_subset_of_v2 and golden_v2_selectors_unknown_at_v1. Renamed asset_surface_excludes_scheduled_selectors -> asset_surface_excludes_v2_only_selectors. Addresses the review-bot consistency finding. Test-only; no V1 behavior/wire change. Co-authored-by: Cursor <cursoragent@cursor.com> * test(BOP-495): assert MultiplierUpdated in matured-pending instant-setter test update_multiplier_clears_matured_pending_without_cancel_event documented the dual-event emission but only asserted UIMultiplierUpdated. Assert MultiplierUpdated at events[len-2] too, mirroring update_multiplier_clears_live_pending_with_cancel_event, making the dual-event contract explicit. Addresses the review-bot finding. Test-only. Co-authored-by: Cursor <cursoragent@cursor.com> * style(BOP-495): apply nightly rustfmt line-wrapping after the error/param renames The UIMultiplierUpdateDoesNotExist / UIMultiplierUpdateExists { effectiveAt } renames shifted two assert_eq! lines across the width boundary; nightly rustfmt (the CI toolchain, which applies the unstable rustfmt.toml rules) rewraps them. No behavior change. Co-authored-by: Cursor <cursoragent@cursor.com> * ci(BOP-495): repin Cobalt base_std_ref to base-std main (base#192 merged) base#192 squash-merged to base-std main as 04d645a. Move the Cobalt conformance pin off the (now-orphaned) PR-branch commit d0a3c16 onto the stable base-std main SHA, per the immutable (base-anvil SHA, base-std SHA) pair convention. Same paired ERC-8056 surface; the gate now validates this base/base PR against base-std main. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Applies the Aug 4 2026 B20 Interface Review follow-ups to the ERC-8056 scaled-multiplier surface (Solidity interface + reference mock + tests + smoke). Paired in lockstep with base/base PR base/base#4285 — land together.
Scope is ERC-8056 + multiplier scheduling only. Every wire change is Cobalt-only (AssetV2, not yet activated on any network) or add-alias + deprecate on the frozen Beryl surface — nothing on-chain breaks.
Changes
IScaledUIAmount.sol→IERC8056.sol(file only; interface identifiers unchanged).ScheduleOverlap→PendingUpdateExists,NoScheduledMultiplier→NoScheduledUIMultiplier,MultiplierUpdateCancelled→UIMultiplierUpdateCancelled.updateUIMultiplieris the canonical instant-failsafe.IScaledUIAmountConversion(0x57854fc3) adopted:toUIAmount/fromUIAmountare the canonical converters, advertised viasupportsInterface.MAX_UI_MULTIPLIER()getter exposes thetype(uint128).maxsetter bound.updateUIMultiplier(and the retainedupdateMultiplier) emits both the deprecatedMultiplierUpdated(newMultiplier)and the ERC-8056UIMultiplierUpdated, so indexers on the legacy topic keep working. The scheduledsetUIMultiplieremits onlyUIMultiplierUpdated.Deprecation model (keep in interface, marked deprecated)
Following the team decision (and mirroring #193's
burnBlockedtreatment), the legacy methodsupdateMultiplier/toScaledBalance/toRawBalanceare kept in theIB20Assetinterface, documentedDEPRECATED.— not removed. They remain dialable and aliased under the new names, so block explorers (which need the advertised legacy surface) and developers (who get the canonical names) are both satisfied.Test plan
forge test— all pass (4 fork-gated skips)forge fmt --check, interface-coverage + forge-coverage greenRefs
BOP-495 (parent BOP-429 / B20 Improvements). Paired base/base PR: base/base#4285.